﻿@model trangbaocao.Models.PermissionModel
<script type="text/javascript">
    treeModel = [{ "data": "Confirm Application", "attr": { "id": "10" }, "children": null }, { "data": "Things", "attr": { "id": "20" }, "children": [{ "data": "Thing 1", "attr": { "id": "21" }, "children": null }, { "data": "Thing 2", "attr": { "id": "22" }, "children": null }, { "data": "Thing 3", "attr": { "id": "23" }, "children": null }, { "data": "Thing 4", "attr": { "id": "24" }, "children": [{ "data": "Thing 4.1", "attr": { "id": "241" }, "children": null }, { "data": "Thing 4.2", "attr": { "id": "242" }, "children": null }, { "data": "Thing 4.3", "attr": { "id": "243" }, "children": null}]}] }, { "data": "Colors", "attr": { "id": "40" }, "children": [{ "data": "Red", "attr": { "id": "41" }, "children": null }, { "data": "Green", "attr": { "id": "42" }, "children": null }, { "data": "Blue", "attr": { "id": "43" }, "children": null }, { "data": "Yellow", "attr": { "id": "44" }, "children": null}]}];
</script>
<script src="@Url.Content("~/Scripts/jquery.jstree.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $("#demoTree").jstree({
            json_data: {
                data: treeModel
            },
            plugins: ["themes", "json_data", "ui", "checkbox"]
        });
    });
</script>

<div class="container_12">       
    <div class="grid_12">            
        <div class="module">
                <h2 align="right"><span><a href="@Url.Action("Index", "Permission")">Quay lại</a></span></h2>                       
                <div class="module-body">
                @using (Html.BeginForm("AddPermission", "Permission", FormMethod.Post, new { id = "AddPermission" }))
                {                      
                    <div align="center"><h3>THÊM MỚI QUYỀN</h3>
                        <div class="add_made" align="center"> 
                            <img src="@Url.Content("~/Content/Body/Images/Body_Images/Permission.png")" width="12%" />
                        </div>
                        
                    </div>
                    
                    if (TempData["msg"] != null)
                    {                            
                        <span class="notification n-error">@TempData["msg"]</span>
                    }  
                    <p></p>
                    <div class="Permission-left" align="left">      
                        <p align="center" style="">
                            <label style="width:80%; text-align:left;">Tên quyền:</label>
                                @Html.TextBoxFor(model => model.name, new { @name = "name", @class = "input-long" }) 
                                <font color="red">(*)</font>
                                    <label style="width:80%; text-align:left;">
                                        @Html.ValidationMessageFor(model => model.name)
                                    </label>                                       
                        </p> 
                       
                    <div class="button" align="center">
                        <p style="text-align:left; width:80%">
                        <input class="submit-green" type="submit" value="Thêm"/> 
                        <input class="submit-gray" type="reset" value="Hủy" />
                        @*<input class="submit-gray" type="button"  onclick="location.href='@Url.Action("Index", "User")'" value="Quay lại" />*@
                        </p>
                    </div>
                    </div>
                }
        <div class="Permission-right-out">
            <div class="Permission-right-in">
                <span style="text-align:center">
                    <H3>NỘI DUNG PHÂN QUYỀN</H3>
                </span>
            </div>
        </div>            
                </div> <!-- End .module-body -->

        </div>  <!-- End .module -->
        <div style="clear:both;"></div>
    </div> <!-- End .grid_12 --> 
    <div style="clear:both;"></div>
</div> <!-- End .container_12 -->